import java.util.Arrays;
import java.util.Scanner;

/**
 * 
 */

/**
 * @author zhongfang
 *
 */
public class 网易22 {

	/**
	 * @param args
	 */
	public static void main(String[] args) {
		Scanner scanner=new Scanner(System.in);
		int n=scanner.nextInt();
		int x[]=new int[n];
		int y[]=new int[n];
		int dis[]=new int[n];
		int res[]=new int[n];
		for (int i = 0; i < n; i++) {
			x[i]=scanner.nextInt();
		}
		for (int i = 0; i < n; i++) {
			y[i]=scanner.nextInt();
		}
		Arrays.fill(res, Integer.MAX_VALUE);
		for (int i = 0; i < n; i++) {
			for (int j = 0; j < n; j++) {
				for (int k = 0; k < n; k++) {
					dis[k]=Math.abs(x[k]-x[i])+Math.abs(y[k]-y[j]);
				}
				Arrays.sort(dis);
				int sum=0;
				for (int k = 0; k < n; k++) {
					sum+=dis[k];
					res[k]=Math.min(res[k], sum);
				}
			}
		}
		String result="";
		for (int i = 0; i < n; i++) {
			result+=String.valueOf(res[i]);
			result+=" ";
		}
		System.out.println(result);
	}
}
